﻿using FreeSql.DataAnnotations;
using LF.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LF.Domain.Entities
{
    /// <summary>
    /// 用户信息
    /// </summary>
    [Table(Name = "SysUser")]
    public class User : BaseEntity
    {
        /// <summary>
        /// 用户名
        /// </summary>
        public string UserName { get; set; }
        /// <summary>
        /// 微信名
        /// </summary>
        public string WeixinName {  get; set; }
        /// <summary>
        /// 真实姓名
        /// </summary>
        public string RealName { get; set; }
        /// <summary>
        /// 手机号
        /// </summary>
        public string Mobile { get; set; }
        /// <summary>
        /// 员工工号
        /// </summary>
        public string UserCode { get; set; }
        /// <summary>
        /// 微信openid
        /// </summary>
        public string OpenId { get; set; }
        /// <summary>
        /// 企业微信用户ID
        /// </summary>
        public string QyWeixinUserId { get; set; }
        /// <summary>
        /// 是否启用
        /// </summary>
        public bool Active { get; set; }
        /// <summary>
        /// 密码
        /// </summary>
        public string Password { get; set; }
        /// <summary>
        /// 头像
        /// </summary>
        public string Avatar { get; set; }
        /// <summary>
        /// 性别
        /// </summary>
        public Gender Gender { get; set; }
        /// <summary>
        /// 邮箱
        /// </summary>
        public string Email { get; set; }
        /// <summary>
        /// 签名
        /// </summary>
        public string Signature { get; set; }
        
        /// <summary>
        /// 省份
        /// </summary>
        public string Province { get; set; }
        
        /// <summary>
        /// 城市
        /// </summary>
        public string City { get; set; }
        
        /// <summary>
        /// 区县
        /// </summary>
        public string District { get; set; }
        
        /// <summary>
        /// 详细地址（门牌号等）
        /// </summary>
        public string Address { get; set; }
        
        /// <summary>
        /// 地址经度
        /// </summary>
        public double? AddressLng { get; set; }
        /// <summary>
        /// 地址纬度
        /// </summary>
        public double? AddressLat { get; set; }
        
        /// <summary>
        /// 自我介绍
        /// </summary>
        public string Introduction { get; set; }
        
     
        
        /// <summary>
        /// 部门ID
        /// </summary>
        public Guid? DeptId { set; get; }

        /// <summary>
        /// 所属部门
        /// </summary>
        [Navigate(nameof(DeptId))]
        public virtual Deptment Deptment { get; set; }
        
        /// <summary>
        /// 用户角色关联
        /// </summary>
        [Navigate(nameof(UserRole.UserId))]
        public virtual List<UserRole> UserRoles { get; set; }
    }
}
